#include <iostream>
#include <string>

/**
 *使用string 比c风格的str 要快
 */

using namespace std;

int main()
{
    int errors = 0;
    string str("a very long literal string");
    for(int ix=0; ix<10000000; ++ix)
    {
        int len=str.size();
        string str2 = str;
        if(str!=str2) ++errors;
    }
    cout << "stgring class:" << errors<< " errors occurred.\n";
}
